package com.cl.edu.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * 学生主动预约教员表
 * Bookingteacher entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "bookingteacher")
public class Bookingteacher implements java.io.Serializable {

	// Fields

	private Long id;  			//表id
	private Teacher teacher;	//预约教师
	private Student student;	//被预约学生
	private Integer state;		//预约状态
	private Date bookTime;     // 预约时间
	

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}


	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "teacherid")
	public Teacher getTeacher() {
		return teacher;
	}

	public void setTeacher(Teacher teacher) {
		this.teacher = teacher;
	}
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "studentid")
	public Student getStudent() {
		return student;
	}

	public void setStudent(Student student) {
		this.student = student;
	}

	@Column(name = "state")
	public Integer getState() {
		return this.state;
	}

	public void setState(Integer state) {
		this.state = state;
	}
	public void setBookTime(Date bookTime) {
		this.bookTime = bookTime;
	}
	@Temporal(TemporalType.DATE)
	@Column(name = "booktime", length = 10)
	public Date getBookTime() {
		return bookTime;
	}
}